#pragma once

#include "bullet_DebugDraw.h"

using std::vector;

BulletDebugDraw::~BulletDebugDraw() = default;

BulletDebugDraw::BulletDebugDraw(vector<PhysicsDebugVertex> &rVertex) : m_rVertex(rVertex)
{
}

void BulletDebugDraw::drawLine(const btVector3& from, const btVector3& to, const btVector3& color)
{
	PhysicsDebugVertex vertex;

	vertex.pos.x = from.getX();
	vertex.pos.y = from.getY();
	vertex.pos.z = from.getZ();
	vertex.pos.w = 1.0f;

	vertex.color.a = 0.3f;
	vertex.color.r = color.getX();
	vertex.color.g = color.getX();
	vertex.color.b = color.getZ();

	m_rVertex.push_back(vertex);

	vertex.pos.x = to.getX();
	vertex.pos.y = to.getY();
	vertex.pos.z = to.getZ();
	vertex.pos.w = 1.0f;

	m_rVertex.push_back(vertex);
}

void BulletDebugDraw::ResetVertex()
{
	m_rVertex.clear();
}